package com.spring.controller;

import com.spring.dao1.UserDao1;
import com.spring.dao2.UserDao2;
import com.spring.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    UserDao1 userDao1;
    @Autowired
    UserDao2 userDao2;
    @GetMapping("/user")
    public void user(){
        User u1=new User();
        u1.setName("鲁迅");
        u1.setAge(55);
        u1.setGander("男");
        userDao1.save(u1);
        User u2=new User();
        u2.setName("泰格尔");
        u2.setAge(80);
        u2.setGander("男");
        userDao2.save(u2);
    }
}
